home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Online / Apache / include / php / ext / standard / php_string.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-27  |  4.6 KB  |  133 lines

  1. /* 
  2.    +----------------------------------------------------------------------+
  3.    | PHP version 4.0                                                      |
  4.    +----------------------------------------------------------------------+
  5.    | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group                   |
  6.    +----------------------------------------------------------------------+
  7.    | This source file is subject to version 2.02 of the PHP license,      |
  8.    | that is bundled with this package in the file LICENSE, and is        |
  9.    | available at through the world-wide-web at                           |
  10.    | http://www.php.net/license/2_02.txt.                                 |
  11.    | If you did not receive a copy of the PHP license and are unable to   |
  12.    | obtain it through the world-wide-web, please send a note to          |
  13.    | license@php.net so we can mail you a copy immediately.               |
  14.    +----------------------------------------------------------------------+
  15.    | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca>                       |
  16.    |          Stig Sæther Bakken <ssb@guardian.no>                        |
  17.    +----------------------------------------------------------------------+
  18. */
  19.  
  20. /* $Id: php_string.h,v 1.27 2000/09/27 15:18:00 sas Exp $ */
  21.  
  22. /* Synced with php 3.0 revision 1.43 1999-06-16 [ssb] */
  23.  
  24. #ifndef PHP_STRING_H
  25. #define PHP_STRING_H
  26.  
  27. PHP_FUNCTION(strspn);
  28. PHP_FUNCTION(strcspn);
  29. PHP_FUNCTION(str_replace);
  30. PHP_FUNCTION(chop);
  31. PHP_FUNCTION(trim);
  32. PHP_FUNCTION(ltrim);
  33. PHP_FUNCTION(soundex);
  34. PHP_FUNCTION(levenshtein);
  35.  
  36. PHP_FUNCTION(count_chars);
  37. PHP_FUNCTION(wordwrap);
  38. PHP_FUNCTION(explode);
  39. PHP_FUNCTION(implode);
  40. PHP_FUNCTION(strtok);
  41. PHP_FUNCTION(strtoupper);
  42. PHP_FUNCTION(strtolower);
  43. PHP_FUNCTION(basename);
  44. PHP_FUNCTION(dirname);
  45. PHP_FUNCTION(pathinfo);
  46. PHP_FUNCTION(strstr);
  47. PHP_FUNCTION(strpos);
  48. PHP_FUNCTION(strrpos);
  49. PHP_FUNCTION(strrchr);
  50. PHP_FUNCTION(substr);
  51. PHP_FUNCTION(quotemeta);
  52. PHP_FUNCTION(ucfirst);
  53. PHP_FUNCTION(ucwords);
  54. PHP_FUNCTION(strtr);
  55. PHP_FUNCTION(strrev);
  56. PHP_FUNCTION(hebrev);
  57. PHP_FUNCTION(hebrevc);
  58. PHP_FUNCTION(user_sprintf);
  59. PHP_FUNCTION(user_printf);
  60. PHP_FUNCTION(addcslashes);
  61. PHP_FUNCTION(addslashes);
  62. PHP_FUNCTION(stripcslashes);
  63. PHP_FUNCTION(stripslashes);
  64. PHP_FUNCTION(chr);
  65. PHP_FUNCTION(ord);
  66. PHP_FUNCTION(nl2br);
  67. PHP_FUNCTION(setlocale);
  68. PHP_FUNCTION(stristr);
  69. PHP_FUNCTION(chunk_split);
  70. PHP_FUNCTION(parse_str);
  71. PHP_FUNCTION(bin2hex);
  72. PHP_FUNCTION(similar_text);
  73. PHP_FUNCTION(strip_tags);
  74. PHP_FUNCTION(str_repeat);
  75. PHP_FUNCTION(substr_replace);
  76. PHP_FUNCTION(strnatcmp);
  77. PHP_FUNCTION(strnatcasecmp);
  78. PHP_FUNCTION(substr_count);
  79. PHP_FUNCTION(str_pad);
  80. PHP_FUNCTION(sscanf);
  81.  
  82. #define strnatcmp(a, b) \
  83.     strnatcmp_ex(a, strlen(a), b, strlen(b), 0)
  84. #define strnatcasecmp(a, b) \
  85.     strnatcmp_ex(a, strlen(a), b, strlen(b), 1)
  86. PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len, int fold_case);
  87.  
  88. PHPAPI char *php_strtoupper(char *s, size_t len);
  89. PHPAPI char *php_strtolower(char *s, size_t len);
  90. PHPAPI char *php_strtr(char *str, int len, char *str_from, char *str_to, int trlen);
  91. PHPAPI char *php_addslashes(char *str, int length, int *new_length, int freeit);
  92. PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int freeit, char *what, int wlength);
  93. PHPAPI void php_stripslashes(char *str, int *len);
  94. PHPAPI void php_stripcslashes(char *str, int *len);
  95. PHPAPI char *php_basename(char *str, size_t  len);
  96. PHPAPI void php_dirname(char *str, int len);
  97. PHPAPI char *php_stristr(unsigned char *s, unsigned char *t, size_t s_len, size_t t_len);
  98. PHPAPI char *php_str_to_str(char *haystack, int length, char *needle,
  99.         int needle_len, char *str, int str_len, int *_new_length);
  100. PHPAPI void php_trim(pval *str, pval *return_value, int mode);
  101. PHPAPI void php_strip_tags(char *rbuf, int len, int state, char *allow, int allow_len);
  102.  
  103. PHPAPI void php_char_to_str(char *str, uint len, char from, char *to, int to_len, pval *result);
  104.  
  105. PHPAPI void php_implode(pval *delim, pval *arr, pval *return_value);
  106. PHPAPI void php_explode(pval *delim, pval *str, pval *return_value, int limit);
  107.  
  108. static inline char *
  109. php_memnstr(char *haystack, char *needle, int needle_len, char *end)
  110. {
  111.     char *p = haystack;
  112.     char *s = NULL;
  113.  
  114.     for(; p <= end - needle_len && 
  115.             (s = memchr(p, *needle, end - p - needle_len + 1)); p = s + 1) {
  116.         if(memcmp(s, needle, needle_len) == 0)
  117.             return s;
  118.     }
  119.     return NULL;
  120. }
  121.  
  122. PHPAPI size_t php_strspn(char *s1, char *s2, char *s1_end, char *s2_end); 
  123. PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end); 
  124.  
  125. #ifndef HAVE_STRERROR
  126. PHPAPI char *php_strerror(int errnum);
  127. #define strerror php_strerror
  128. #endif
  129.  
  130. void register_string_constants(INIT_FUNC_ARGS);
  131.  
  132. #endif /* PHP_STRING_H */
  133.